import {createRouter, createWebHistory} from 'vue-router'
import Layout from "@/layout/Layout.vue";

const routes = [


    {
        path: '/',
        name: 'Layout',
        component: Layout,
        redirect: "HotelRoom",  //路由重定向，当访问/时，自动跳转到user
        //子菜单的路由
        children: [
            {
                path: '/HotelRoom',
                name: 'HotelRoom',
                //引入对应的界面
                component: () => import("@/views/HotelRoom.vue"),
                meta: { showSidebar: true }
            },
            {
                path: '/CheckIn',
                name: 'CheckIn',
                //引入对应的界面
                component: () => import("@/views/CheckIn.vue"),
                meta: { showSidebar: true }
            },
            {
                path: '/CheckOut',
                name: 'CheckOut',
                //引入对应的界面
                component: () => import("@/views/CheckOut.vue"),
                meta: { showSidebar: true }
            },
            {
              path: '/Finance',
              name:'Finance',
              component: () => import("@/views/Finance.vue"),
                meta: { showSidebar: true }
            },

            {
                path: '/HotelBooking',
                name:'HotelBooking',
                component: () => import("@/views/HotelBooking.vue"),
                 meta: { showSidebar: true }
            },


            {
                path: '/Home',
                name:'Home',
                component: () => import("@/views/Home.vue"),
                meta: { showSidebar: false }
            },
            {
                path: '/HotelRoomInfo',
                name: 'HotelRoomInfo',
                component: () => import("@/views/HotelRoomInfo.vue"),
                meta: {showSidebar: false}
            },
            {
                path: '/PersonalCenter',
                name:'PersonalCenter',
                component: () => import("@/views/PersonalCenter.vue"),
                meta: {showSidebar: false}
            },
            {
                path: '/PersonalCenterSidebar',
                name:'PersonalCenterSidebar',
                component: () => import("@/views/PersonalCenterSidebar.vue"),
                meta: {showSidebar: false}
            }



        ],



    },



    {
        path: '/login',
        name: 'Login',
        //此处导入Login登录界面
        component: () => import("@/views/Login.vue")
    },

    {
        path: '/register',
        name: 'Register',
        //此处导入Login登录界面
        component: () => import("@/views/Register.vue")
    },


]

const router = createRouter({
    history: createWebHistory(process.env.BASE_URL),
    routes
})

export default router
